﻿@model Kooboo.CMS.Content.Models.SendingSetting
@{
    ViewBag.Title = "New sending setting".Localize();
    Layout = "~/Views/Shared/Blank.cshtml";
}
@section Panel{
    <ul class="panel">
        <li>
            <a data-ajaxform="">
                @Html.IconImage("save") @("Save".Localize())</a>
        </li>
        @foreach (var group in Kooboo.CMS.Sites.Extension.UI.TopToolbar.ToolbarButtons.GetToolbarButtons(ViewContext.RequestContext))
        {
            @Html.Partial("_ToolbarGroupButtons", group)
        }
        <li>
            <a href="@ViewContext.RequestContext.GetRequestValue("return")">
                @Html.IconImage("cancel") @("Back".Localize())</a>
        </li>
    </ul>
}
<div class="block common-form">
    <h1 class="title">@ViewBag.Title</h1>
    @using (Html.BeginForm())
    { 
        <table>
            <tbody>
                @Html.EditorFor(m => m.FolderName)
                @Html.EditorFor(m => m.SendReceived)
                @Html.EditorFor(m => m.SendToChildSites)
                @Html.EditorFor(m => m.ChildLevel)
                @Html.EditorFor(m => m.KeepStatus)
            </tbody>
        </table>     
    }
</div>
<script>
    $(function () {
        var keepStatusTr = $('#KeepStatus').parent().parent();
        var childLevel = $('[name=ChildLevel]').parent().parent().parent().parent();
        keepStatusTr.hide();
        childLevel.hide();
        $('#SendToChildSites').change(function () {
            var sendToChildSites = $(this);

            if (sendToChildSites.is(':checked')) {
                keepStatusTr.show();
                childLevel.show();
            }
            else {
                keepStatusTr.hide();
                childLevel.hide();
            }
        });
    });
</script>
